<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>统计数字字符出现的数量.html</title>
	</head>
	<body>
		<script>
			/**
			 * unicode
			 * 48-57:0-9
			 * 65-90 A-Z
			 * 97-122 a-z
			 * 19968 40869 汉子
			 * 
			 * */
			var str="xiao今333天联网APP&&&天"
			var en=0;
			var nm=0;
			var cha=0;
			var xx=0;
			for (var i=0;i<str.length;i++) {
				var num=str.charCodeAt(i);
				if(num>=19968&&num<=40869){
					cha++;
				}else if((num>=65&&num<=90)||(num>=97&&num<=122)){
					en++;
				}else if(num>=48&&num<=57){
					console.log(nm)
					nm++;
				}else{
					xx++;
				}
			}
			console.log(cha+"\n"+en+"\n"+nm+"\n"+xx)
		</script>
	</body>
</html>
